package UIUtils {
	import UIFree.uif_app;
	
	import flash.external.ExternalInterface;
	import flash.geom.Point;

	public class uif_externalUtils {
		public static function getScrollOffset(): Point {
			return new Point(int(ExternalInterface.call('eval', 'window.pageXOffset || document.scrollLeft')), 
					int(ExternalInterface.call('eval', 'window.pageYOffset || document.scrollTop')));
		}
		
		public static function getClientSize(): Point {
			var result: Point = new Point(int(ExternalInterface.call('eval', 'window.innerWidth || document.clientWidth')), 
				int(ExternalInterface.call('eval', 'window.innerHeight || document.clientHeight')));
			result.x = result.x?result.x:uif_app.instance().width; 
			result.y = result.y?result.y:uif_app.instance().width; 
			return result;			
		}
	}
}